/**
 * Display data of game: aircraft status and weapon status.
 * @returns {Display}
 */
Display = function( aircraft, x, y, z )
{
    this.aircraft = aircraft;
    
    this.initComponent( x, y, z );
    
    this.update = function( elapsedTime, context )
    {
    };

    this.draw = function( elapsedTime, context )
    {
        this.drawStatusBox( context );
    };

    this.drawStatusBox = function( context )
    {
        context.fillStyle = "#000000";    
        context.strokeRect( 1, 1, 100, 25 );
        context.fillStyle = "#FFFFFF";    
        context.fillRect( 1, 1, 100, 25 );
        
        this.drawWeaponStatus( context, this.aircraft.selectedWeapon );
    };
    
    this.drawWeaponStatus = function( context, weapon )
    {
        if ( weapon )
        {
            context.fillStyle = "#000000";    
            context.fillText( weapon.name, 6, 11 );
            context.fillText( weapon.munitions, 6, 22 );
            context.drawImage( weapon.loadShot().image, 80, 5 );
        }
        else
        {
            context.fillStyle = "#FF0000";    
            context.fillText( "No weapon.", 6, 11 );    
            context.fillText( "Press 1 or 2.", 6, 22 );    
        }
    };
 
};

Display.prototype = new Component;
